package com.project.forlearningdemo.controller;

import com.project.forlearningdemo.service.ReportResourceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 举报表操作
 */
@RequestMapping("report")
@Api(value = "CheckResourceController", tags={"前台举报相关的API"})
@RestController
@CrossOrigin
public class ReportResourceController {

    @Autowired
    private ReportResourceService reportResourceService;

    @ApiOperation("用户点击举报提交之后，添加到举报表中")
    @PostMapping("{userId}/{resourceId}")
    public String addReportResource(@PathVariable("userId") int userId, @PathVariable("resourceId") int resourceId,@RequestBody String report){
        return reportResourceService.addReportResource(userId, resourceId, report);
    }


}
